﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LanguagePolish.EntityModel;

namespace LanguagePolish.Controls.Meta
{
    class TeacherLessonsProvider: ILessonsProvider
    {
        private readonly Teacher teacher;

        public TeacherLessonsProvider(Teacher teacher)
        {
            if (teacher == null)
                throw new ArgumentNullException("teacher");
            this.teacher = teacher;
        }

        public IEnumerable<Lesson> GetLessons(DateTime from, DateTime to)
        {
            var res = teacher.Lessons.Where(l => l.LessonDate >= from && l.LessonDate <= to).ToList();
            return res;
        }
    }
}
